﻿@model List<TJBHJJ.Models.Down>
@{
    ViewBag.Title = "下载列表";
    int pagecount = (int)ViewData["pageCount"];
    int pageindex = (int)ViewData["pageIndex"];
}
<script type="text/javascript">
    $(function () {
        $("#tabs").tabs();
    });
</script>
<div id="tabs">
    <ul>
        <li><a href="#tabs-1">下载列表</a></li>
    </ul>
    <div id="tabs-1">
        <table>
            <tr style="background-color: #e8eef4">
                <td style="width: 200px">
                    名称
                </td>
                <td style="width: 400px">
                    描述
                </td>
                <td style="width: 50px">
                    修改
                </td>
                <td style="width: 50px">
                    删除
                </td>
            </tr>
            @foreach (var v in Model)
            {
                if (v.Name != null)
                {
                <tr>
                    <td>
                        @(v.Name.Length > 13 ? v.Name.Substring(0, 13) + "..." : v.Name)
                    </td>
                    <td>@(v.Content.Length > 30 ? v.Content.Substring(0, 30) + "..." : v.Content)
                    </td>
                    <td>@Html.ActionLink("修改", "EditDown", new { page = pageindex, id = v.Id })
                    </td>
                    <td>@Html.ActionLink("删除", "DeleteDown", new { page = pageindex, id = v.Id }, new { onclick = "return confirm('确认删除吗？')" })
                    </td>
                </tr>
                }
            }
            <tr>
                <td colspan="4" align="center">
                    @Html.ActionLink("[首页]", "ListDown", new { page = 0 })
                    @for (int i = 1; i < pagecount; i++)
                    {
                        if (i == pageindex)
                        {
                        <strong style="color: Red;">@Html.ActionLink("[" + i + "]", "ListDown", new { page = i })</strong>
                        }
                        else
                        {
                        @Html.ActionLink("[" + i + "]", "ListDown", new { page = i })
                        }
                    }
                    @Html.ActionLink("[末页]", "ListDown", new { page = pagecount })
                </td>
            </tr>
            <tr>
                <td colspan="4">
                    @Html.ActionLink("添加下载", "AddDown")
                </td>
            </tr>
        </table>
    </div>
</div>
